<template>
  <div id="app">
    <van-nav-bar class="navbar" title="demo" />
    <router-view />
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  created () {
    this.$browser.init()
    this.$browser.defineBack((payload, callback) => {
      // 按android返回键返回上一页,home时点两下退出
      if (this.$route.name === 'Home') {
        callback(false)
      } else {
        this.$router.back()
        callback(true)
      }
      return true
    })
  }
}
</script>
<style>
body,
html {
  height: 100%;
}
#app {
  height: 100%;
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  background-color: #f5f6fa;
  overflow: hidden;
}
.navbar{
  /* background-color: #4363FF;
  color:#fff */
      padding-top: 26px;
}
#nav {
  padding: 30px;
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

#nav a.router-link-exact-active {
  color: #42b983;
}
</style>
